import fetch from './fetch'

export default function (file, url) {
  const form = new FormData()
  form.append('image', file, file.name)
  return fetch({
    url,
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data: form
  })
}
